<?php
namespace app\common\exception;


class BaseException extends \RuntimeException
{
    protected $error;
    // 错误具体信息
    public $msg = '参数错误';
    // 自定义的错误代码
    public $errorCode = 10000;

    public function __construct($error, $code = 422)
    {
        $this->error   = $error;
        $this->msg = is_array($error) ? implode("\n\r", $error) : $error;
        $this->code    = $code;
    }

}
